#include "config.h" 
 
#define      N_TASKS           2      // Number of tasks 
#define      TASK_STK_SIZE   128   // Stack size 
 
OS_STK  TaskStk[N_TASKS][TASK_STK_SIZE];    // Tasks stacks 
 
void Task0(void *pdata); 
void Task1(void *pdata); 
 
// Entrance of C prog 
int main_entry (void) 
{ 
    OSInit(); 
  OSTaskCreate(Task0, (void *)0, &TaskStk[0][TASK_STK_SIZE-1], 0); 
  OSTaskCreate(Task1, (void *)0, &TaskStk[1][TASK_STK_SIZE-1], 1); 
    TargetInit(); 
    OSStart(); 
    return 0; 
} 
 
void Task0(void *pdata) 
{ 
    char    str[] = "Lv "; 
    INT32U  str_size = sizeof(str), i;
    pdata = pdata;      // Avoid compilation warning. 
    while(1) 
    { 
        for( i=0; i<str_size; i++ ) 
        { 
            U0THR = str[i]; 
        } 
        OSTimeDly(500); 
    } 
} 
  
void Task1(void *pdata) 
{ 
    char    str[] = "Chao "; 
    INT32U  str_size = sizeof(str), i; 
 
    pdata = pdata;      // Avoid compilation warning. 
    while(1) 
    { 
        for( i=0; i<str_size; i++ ) 
        { 
            U0THR = str[i]; 
        } 
        OSTimeDly(500); 
    } 
    
} 

